package com.kaishengit.dao;

import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.kaishengit.core.dao.BaseDao;
import com.kaishengit.pojo.Company;
import com.kaishengit.pojo.Employee;
import com.kaishengit.pojo.Product;

@Repository
public class CompanyDao extends BaseDao<Company, Integer>{

	@SuppressWarnings("unchecked")
	public List<Company> findAllCompany(Employee e, Product p) {
		String hql = "from Company where employee = ? and product = ?";
		Query query = getSession().createQuery(hql);
		query.setParameter(0, e);
		query.setParameter(1, p);
		
		return query.list();
		
	}


}
